<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" >

	<ui:composition template="/templates/telainicialPaginaSemBanner.xhtml" >
		<ui:define name="js">
		
		</ui:define>
		<ui:define name="css">
			<link rel="stylesheet" type="text/css" href="style/folha2.css" media="screen" />
			<link rel="stylesheet" type="text/css" href="style/styles.css" media="screen" />
			<link rel="stylesheet" type="text/css" href="style/folhaextra.css" media="screen" />
			<style type="text/css">
				body {
					margin-left: 0px;
					margin-top: 0px;
					margin-right: 0px;
					margin-bottom: 0px;
				}
				a:link {
					color: #2f3191;
					text-decoration: none;
				}
				a:visited {
					text-decoration: none;
					color: #2f3191;
				}
				a:hover {
					text-decoration: underline;
					color: #0033FF;
				}
				a:active {
					text-decoration: none;
					color: #2f3191;
				}
			</style>
		</ui:define>
		
		<ui:define name="linkusa">
			<h:form>
   	  			<a4j:commandLink action="#{telaInicialBean.inicio}">
   	  				<img src="images/logo.gif" width="198" height="96" />
   	  			</a4j:commandLink>
   	  		</h:form>
		</ui:define>
		
		<ui:define name="linksup1">
			<h:form>
    			<a4j:commandLink action="#{telaInicialBean.sobreUsaPre}" value="Sobre o USACARD PRÉ" styleClass="menusupclass" />
   			</h:form>
		</ui:define>
		<ui:define name="linksup2">
			<h:form>
    			<a4j:commandLink action="#{telaInicialBean.todasAsVantagens}" value="+ Vantagens" styleClass="menusupclass" />
   			</h:form>
		</ui:define>
		<ui:define name="linksup3">
			<h:form>
       			<a4j:commandLink action="#{telaInicialBean.duvidasFrequentes}" value="Dúvidas Frequentes" styleClass="menusupclass" />
       		</h:form>
		</ui:define>
		<ui:define name="linksup4">
			<h:form>
       			<a4j:commandLink action="#{telaInicialBean.contatos}" value="Contato" styleClass="menusupclass" />
       		</h:form>	
		</ui:define>
		
		<ui:define name="login">
			<h:form>
				
	       	  	<div class="login_box">
		       	    <div class="logado" align="center">Olá, <strong><h:outputText value="#{sessionUsaPreBean.nome}!" /></strong></div>
		       	    <div class="text3" id="link2" align="center">
		       	    	<a4j:commandLink value="área cliente" action="#{telaInicialBean.areacliente}" /> | 
		       	    	<a4j:commandLink value="sair" action="#{telaInicialBean.sair}" />
		       	    </div>
	          	</div>
				
			</h:form>
		</ui:define>	
		<ui:define name="conteiner1">
			<h:form>
        		<a4j:commandLink styleClass="itemmidsupclass" value="PEÇA O SEU" action="#{telaInicialBean.cadastreSe}" />
			</h:form>
		</ui:define>	
		<ui:define name="conteiner2">
			<h:form>
				<a4j:commandLink styleClass="itemmidsupclass" value="RECARREGUE" action="#{logadoBean.goHomeRecarregue}" />
			</h:form>
		</ui:define>
		<ui:define name="conteiner3">
			<h:form>
				<a4j:commandLink styleClass="itemmidsupclass" value="COMPRE COM DESCONTO" action="#{telaInicialBean.compreComDesconto}" />
			</h:form>
		</ui:define>
		<ui:define name="conteiner4">
			<h:form>
				<a4j:commandLink styleClass="itemmidsupclass" value="CONHEÇA A REDE" action="#{telaInicialBean.conhecaARede}" />
			</h:form>
		</ui:define>
		<ui:define name="conteiner5">
			<h:form>
				<a4j:commandLink styleClass="itemmidsupclass" value="LOJISTA" action="#{telaInicialBean.lojista}" />
			</h:form>
		</ui:define>
		
		<ui:define name="banner">
			
		</ui:define>
		<ui:define name="interior">
			
			<div class="ranking_part1"><strong>Lista de Estabelecimentos</strong></div>
        	<div class="regua_ranking"></div>
      		
      		<div class="cabecalho_ranking_inside3">
        		<h:form>
				    <div class="campos1_a"><strong>Estado</strong></div>
				    <div class="campos2_a1"><strong>Cidade</strong></div>
				    <div class="campos2_a1"><strong>Bairro</strong></div>
				    <div class="campos3_a1"> <strong>Ramo de atividade</strong></div>
				    <div class="campos3_a2"><strong>Nome do estabelecimento</strong></div>
				    <div class="campos1">
				    	<h:selectOneMenu value="#{descontoBean.uf}" converter="ufConverter" style="width:50px" >
		          			<f:selectItem itemLabel="Uf" noSelectionOption="true" />
		          			<f:selectItems value="#{descontoBean.ufs}" var="uf" itemLabel="#{uf.sigla}" itemValue="#{uf}" />
		          			<f:ajax event="change" listener="#{descontoBean.atualizaCidade}" render="cidadeField" />
		          		</h:selectOneMenu>
				    </div>
				    <div class="campos2_1">
				      	<h:selectOneMenu id="cidadeField" value="#{descontoBean.cidade}" converter="cidadeConverter" style="width:160px">
	       	    			<f:selectItem itemLabel="Selecione a Cidade" noSelectionOption="true" />
		          			<f:selectItems value="#{descontoBean.cidades}" var="cidade" itemLabel="#{cidade.nome}" itemValue="#{cidade}" />
		          			<f:ajax event="change" listener="#{descontoBean.atualizaBairro}" render="bairroField" />
		          		</h:selectOneMenu>
				    </div>
				    <div class="campos2_1">
				      	<h:selectOneMenu id="bairroField" value="#{descontoBean.bairro}" converter="bairroConverter" style="width:160px">
	       	    			<f:selectItem itemLabel="Selecione o Bairro" noSelectionOption="true" />
		          			<f:selectItems value="#{descontoBean.bairros}" var="bairro" itemLabel="#{bairro.nome}" itemValue="#{bairro}" />
		          		</h:selectOneMenu>
				    </div>
				    <div class="campos3_1">
				      	<h:selectOneMenu value="#{descontoBean.ramoAtividade}" converter="ramoAtividadeConverter" style="width:160px">
	      	      			<f:selectItem itemLabel="Ramo de Atividade" noSelectionOption="true" />	
		          			<f:selectItems value="#{descontoBean.ramoAtividades}" var="rm" itemLabel="#{rm.nome}" itemValue="#{rm}" />
		          		</h:selectOneMenu>
				    </div>
				    <div class="campos3_1_2">
				      	<rich:inplaceInput defaultLabel="Nome do Estabelecimento" value="#{descontoBean.nomeEstabelecimento}" style="width:155px" />
	    			</div>
				    <div class="campos1"></div>
				    <div class="campos2_1"></div>
				    <div class="campos2_1"></div>
				    <div class="campos3_1"></div>
	    			<div class="campos3_1" align="right"> 
	    				<a4j:commandLink action="#{descontoBean.buscarCompreComDesconto}" execute="@form" >
	        				<img src="images/enviar2.gif" width="40" height="20" />
	        			</a4j:commandLink>
	    			</div>
	    		</h:form>	
  			</div>
      	
      		<div class="ranking_part2">
      			<img src="images/6px.gif" width="6" height="6" /><strong>ESTABELECIMENTO</strong>
      		</div>
       		<div class="ranking_part3" align="center"><strong>FONE</strong></div>
       		<div class="ranking_part3" align="center"><strong>MAPA</strong></div>
        
	        <a4j:repeat id="table" value="#{descontoBean.enderecoParceiros}" var="enderecoParceiros" >
		        <h:form>
			        <div class="ranking_part2_a">
			        	<strong><h:outputText value="#{enderecoParceiros.parceiro.nomeLimitado2}" title="#{enderecoParceiros.parceiro.nomeSimpl}" /></strong>
			        	<br />
			        	<h:outputText value="#{enderecoParceiros.enderecoNomeMin2}" title="#{enderecoParceiros.enderecoNome}" />
			        	<br />
			          	<h:outputText value="#{enderecoParceiros.logradouro.bairro.cidade.nomeMin} - #{enderecoParceiros.logradouro.bairro.cidade.uf.sigla}" />
			        </div>
			        <div class="ranking_part3_a"><h:outputText value="#{enderecoParceiros.parceiro.telefone}" /></div>
			        <div class="ranking_part3_a">
			        	<a4j:commandLink action="#{descontoBean.mapa}" execute="@this" >
			        		<img src="images/icone_mapa.gif" alt="" width="45" height="40" />
			        	</a4j:commandLink>
			        </div>     
		        </h:form>   
	        </a4j:repeat>
	        
	
	        <div class="rodape_ranking" id="link_azul">
	        	<rich:dataScroller for="table" maxPages="5" />
	        </div>
			
		</ui:define>	
		
	</ui:composition>

</html>